package com.happycat.controller;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.happycat.Pagination;
import com.happycat.ResponseHeaderModel;
import com.happycat.ResponseModel;
import com.happycat.mobile.model.UserLoginLog;
import com.happycat.mobile.service.UserLoginLogService;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liaoyong
 * @since 2020-07-23
 */
@RestController
@RequestMapping("/userLoginLog")
@Api(value = "用户登录日志", description = "用户登录日志接口")
public class UserLoginLogController {
    @Autowired
	private UserLoginLogService userLoginLogService;
	
	@ApiOperation(value = "用户登录日志详情")
    @RequestMapping(method = RequestMethod.POST, value = "/detail")
	public ResponseModel<UserLoginLog> detail(@RequestBody UserLoginLog userLoginLog){
		return userLoginLogService.selectOne(userLoginLog);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/page")
	@ApiOperation(value = "用户登录日志分页列表")
	public ResponseModel<Page<UserLoginLog>> Page(@RequestBody Pagination<UserLoginLog>page){
		return userLoginLogService.pageList(page);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/add")
	@ApiOperation(value = "用户登录日志新增")
	public ResponseHeaderModel add(@RequestBody UserLoginLog userLoginLog){
	
	   return userLoginLogService.add(userLoginLog);
	}
	@ApiOperation(value = "用户登录日志编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/modify")
	public ResponseHeaderModel modify(@RequestBody UserLoginLog userLoginLog){
	
	   return userLoginLogService.modify(userLoginLog);
	}
	
}

